#!/usr/bin/python
# *-* coding: utf-8 *-*

from pyEcodex2 import ECODEX

# toma el uuid generado en la factura de pruebas
uuid = 'C72E5194-DFF1-45E0-B263-2E57510BFBCC'
rfc = 'AAA010101AAA'

pac = ECODEX(rfc)
if pac.ObtenerXML(uuid):
    f = open('Recuperada-%s' % uuid, 'w')
    f.write(pac.xml)
    f.close()
    print ('Factura recuperada correctamente')
else:
    print (pac.error)